<template>
    <button @click="add">+1</button>
    <p v-bind="$attrs">{{father}}</p>
    <p>{{count}}</p>
    <p>{{gb}}</p>
</template>

<script>
import {ref} from 'vue'
export default {
  props:['father'],
  data() {
    return {
      text:'111'
    }
  },
  inject:{
    gb: {
      from: 'globalData'
    }
  },
  setup () {
    let count = ref(0)
    const add = () => {
      count.value ++
    }

    return {add,count}
  }
}
</script>

<style lang="scss" scoped>

</style>